<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 6.2.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/works/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/works/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/works/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/works/images/logo.svg" color="#222">

<link rel="stylesheet" href="/works/css/main.css">

<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Consolas:300,300italic,400,400italic,700,700italic|PingFang SC:300,300italic,400,400italic,700,700italic&display=swap&subset=latin,latin-ext">
<link rel="stylesheet" href="/works/lib/font-awesome/css/all.min.css">
  <link rel="stylesheet" href="//cdn.jsdelivr.net/gh/fancyapps/fancybox@3/dist/jquery.fancybox.min.css">
  <link rel="stylesheet" href="/works/lib/pace/pace-theme-bounce.min.css">
  <script src="/works/lib/pace/pace.min.js"></script>

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"chudod.gitee.io","root":"/works/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"hide","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":true,"scrollpercent":true},"bookmark":{"enable":true,"color":"#222","save":"auto"},"fancybox":true,"mediumzoom":false,"lazyload":true,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"manual","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":true,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="本篇为小王同学的第4篇操作系统知识：Linux的Ext2文件系统">
<meta property="og:type" content="article">
<meta property="og:title" content="文件系统概念和Ext2文件系统">
<meta property="og:url" content="https://chudod.gitee.io/works/2022/05/18/OS_FileSystem/index.html">
<meta property="og:site_name" content="Computing Dynamics">
<meta property="og:description" content="本篇为小王同学的第4篇操作系统知识：Linux的Ext2文件系统">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://note.youdao.com/yws/api/personal/file/WEB200ceca287a455a1754af8fc6e802128?method=download&shareKey=69113f8f61e335d1864757cf6d288929">
<meta property="og:image" content="https://note.youdao.com/yws/api/personal/file/WEB5c6be0c67c8d7e412bb46a0fc7dfc4b2?method=download&shareKey=69113f8f61e335d1864757cf6d288929">
<meta property="og:image" content="https://note.youdao.com/yws/api/personal/file/WEB59ac0acfacd302c44a1c25b94075ea37?method=download&shareKey=69113f8f61e335d1864757cf6d288929">
<meta property="og:image" content="https://note.youdao.com/yws/api/personal/file/WEB3edb3a5062775e84e27a1b3baf7214d4?method=download&shareKey=69113f8f61e335d1864757cf6d288929">
<meta property="og:image" content="https://note.youdao.com/yws/api/personal/file/WEB8ccdb56ae2d2ddd63d7a13a576d23bb1?method=download&shareKey=69113f8f61e335d1864757cf6d288929">
<meta property="og:image" content="https://note.youdao.com/yws/api/personal/file/WEB8773c112d52de95d6691bdec4e7ea012?method=download&shareKey=69113f8f61e335d1864757cf6d288929">
<meta property="og:image" content="https://note.youdao.com/yws/api/personal/file/WEBb353acd38c3d124728dfb939d9eb1472?method=download&shareKey=69113f8f61e335d1864757cf6d288929">
<meta property="og:image" content="https://note.youdao.com/yws/api/personal/file/WEB4f0be2bb01668eba716ad737927f1217?method=download&shareKey=69113f8f61e335d1864757cf6d288929">
<meta property="article:published_time" content="2022-05-17T16:00:00.000Z">
<meta property="article:modified_time" content="2022-05-21T03:38:42.804Z">
<meta property="article:author" content="虎王">
<meta property="article:tag" content="操作系统">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://note.youdao.com/yws/api/personal/file/WEB200ceca287a455a1754af8fc6e802128?method=download&shareKey=69113f8f61e335d1864757cf6d288929">

<link rel="canonical" href="https://chudod.gitee.io/works/2022/05/18/OS_FileSystem/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>文件系统概念和Ext2文件系统 | Computing Dynamics</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

<link rel="alternate" href="/works/rss2.xml" title="Computing Dynamics" type="application/rss+xml">
</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/works/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">Computing Dynamics</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">小王同学的工作站</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/works/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/works/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/works/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/works/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/works/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
        <li class="menu-item menu-item-schedule">

    <a href="/works/schedule/" rel="section"><i class="fa fa-calendar fa-fw"></i>日程表</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container"></div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div class="algolia-results">
  <div id="algolia-stats"></div>
  <div id="algolia-hits"></div>
  <div id="algolia-pagination" class="algolia-pagination"></div>
</div>

      
    </div>
  </div>

</div>
    </header>

    
  <div class="reading-progress-bar"></div>
  <a role="button" class="book-mark-link book-mark-link-fixed"></a>

  <a href="https://github.com/Chu-DoD" class="github-corner" title="Follow me on GitHub" aria-label="Follow me on GitHub" rel="noopener" target="_blank"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://chudod.gitee.io/works/2022/05/18/OS_FileSystem/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/works/images/avatar.png">
      <meta itemprop="name" content="虎王">
      <meta itemprop="description" content="喜欢造飞机导弹和计算机的大学生">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Computing Dynamics">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          文件系统概念和Ext2文件系统
        </h1>

        <div class="post-meta">

        
          <i class="fa fa-thumb-tack"></i>
          <font color=7D26CD>置顶</font>
          <span class="post-meta-divider">|</span>
        
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2022-05-18 00:00:00" itemprop="dateCreated datePublished" datetime="2022-05-18T00:00:00+08:00">2022-05-18</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2022-05-21 11:38:42" itemprop="dateModified" datetime="2022-05-21T11:38:42+08:00">2022-05-21</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/works/categories/%E8%AE%A1%E7%AE%97%E6%9C%BA%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/" itemprop="url" rel="index"><span itemprop="name">计算机基础知识</span></a>
                </span>
                  ，
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/works/categories/%E8%AE%A1%E7%AE%97%E6%9C%BA%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/" itemprop="url" rel="index"><span itemprop="name">操作系统</span></a>
                </span>
            </span>

          
            <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span id="busuanzi_value_page_pv"></span>
            </span>
            <div class="post-description">本篇为小王同学的第4篇操作系统知识：Linux的Ext2文件系统</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h1 id="文件系统概念"><a href="#文件系统概念" class="headerlink" title="文件系统概念"></a>文件系统概念</h1><p>我在本科第一次学习“文件系统”时，觉得这一章的很多概念仿佛如空中楼阁，因为“文件系统”太抽象了，后来才慢慢加深理解，其实文件系统就是磁盘管理，也可以说文件系统是物理设备的高级抽象。硬盘（低速设备）读写单位是扇区，通常为512 Bytes，而文件系统的读写单位是块（若干个扇区组成，为了避免频繁访问磁盘，一次读入多个块）。为了管理这些块，需要各种数据结构。</p>
<h2 id="inode和文件控制块FCB"><a href="#inode和文件控制块FCB" class="headerlink" title="inode和文件控制块FCB"></a>inode和文件控制块FCB</h2><p>一个文件被拆分成多个块来存储，因此需要一种文件组织方式。以Windows的FAT32为例，FAT是文件分配表(File Allocation Table)，所有的块被用链式结构来组织，在每一块的最后记录下一块的地址，这样文件不需要连续存储，节省了磁盘空间。FAT文件系统为每个文件都分配了一个FAT表，用单独的链式结构来存储、跟踪文件的所有块。FAT文件系统的缺点是文件查找效率地下，为了定位到最后一个数据块，需要遍历前面的所有数据块，且每访问一个块就涉及一次磁盘寻道，使得本就低速的磁盘访问更加频繁，也许微软受不了FAT32文件系统，后来推出了NTFS文件系统(下图来自《操作系统概念》)。</p>
<div style = "align: center">
<img data-src="https://note.youdao.com/yws/api/personal/file/WEB200ceca287a455a1754af8fc6e802128?method=download&shareKey=69113f8f61e335d1864757cf6d288929" width="40%" height="40%"/>  

<p>Unix的文件系统比较先进，采用索引结构来组织文件块，文件块依然可以零散地分布在磁盘中，但Unix文件系统为每个文件的所有块都建立了一个索引表，索引表就是块地址数组，数组元素就是块的地址，访问任意一个块只需要从索引表获得块地址就可以了，速度大大提升。包含此索引表的索引结构就是index node，简称inode(i节点)。任何一个文件都有一个inode，inode记录了文件的所有信息，包括一个索引表，记录文件所有块的块地址。索引结构的缺点是索引结构本身要占一定的存储空间，文件越大，块越多，索引表越大，因此Unix采取了一个折中的方法，采用多级索引结构：inode的索引表一共15个索引项，如果文件块小于12块，那么将这12块的块地址直接存储在前12个索引项中，这前面12个索引可以直接获得块地址，如果文件大于12块，就用第13个索引（一级索引指针）指向一个新的块，新的一块存储256个块地址（一个块1024字节，一个块地址4字节，所以可以存储256个块地址），因此一级索引结构可以存储12+256&#x3D;268个块。如果文件大于268个块，就建立二级索引指针，因此inode索引表的第14个索引是二级索引指针，，第15个是三级索引指针，这样可以管理非常大的文件（文件最多$12+256+256\times{256}+256\times{256}\times{256}块\approx{16.06G}$，如果一个块1024个字节）。</p>
<div style = "align: center">
<img data-src="https://note.youdao.com/yws/api/personal/file/WEB5c6be0c67c8d7e412bb46a0fc7dfc4b2?method=download&shareKey=69113f8f61e335d1864757cf6d288929" width="50%" height="50%"/>  

<p>只要用于控制和管理文件相关信息的数据结构都叫文件控制块FCB(File Control Block)，因此inode也是FCB的一种。并且inode的数量等于文件数量，为了方便管理，分区中所有文件的inode都用一个大表格(inode_table)来维护，用单独的几个磁盘块来存储这个表格，再结合inode位图（单独的一块）。表格就是一个数组，数组中的元素就是inode地址，数组的下标就是inode的编号。可以根据inode编号来查询inode地址。Linux中的inode的定义如下（少了3个字段，但是不重要，没贴出来，来自《深入理解Linx内核》）：</p>
<div style = "align: center">
<img data-src="https://note.youdao.com/yws/api/personal/file/WEB59ac0acfacd302c44a1c25b94075ea37?method=download&shareKey=69113f8f61e335d1864757cf6d288929" width="70%" height="70%"/>  

<h2 id="目录项与目录"><a href="#目录项与目录" class="headerlink" title="目录项与目录"></a>目录项与目录</h2><p>在Unix的inode中，缺少了一个对用户来说至关重要的属性：文件名。用户给出文件名来访问文件，而文件系统通过inode来定位数据块（文件名对文件系统来说不重要，有了inode即可）。因此目录的作用就是将文件名和inode绑定。用户给出文件名，文件在目录项中找到文件名对应的inode，然后再找到数据块。<br>在Linux中，目录和文件都用inode来表示，因此目录也是一种文件。inode同时指向目录和普通文件，磁盘文件系统中没有一种叫做目录的数据结构，磁盘上有的只是inode，inode指向文件实体的数据块，而不关心数据块具体的内容，因此目录和普通文件本质的区别就是“数据块上记录的内容”不同。例如，一个.txt文本文件的数据块记录的是文本文件的ASCII码，而一个目录文件的数据块，记录的内容是目录下包含的所有目录项，如下所示：</p>
<div style = "align: center">
<img data-src="https://note.youdao.com/yws/api/personal/file/WEB3edb3a5062775e84e27a1b3baf7214d4?method=download&shareKey=69113f8f61e335d1864757cf6d288929" width="70%" height="70%"/>  

<p>其中’.’表示当前目录，’..’表示上一级目录，每一个目录项的字段如下所示：</p>
<div style = "align: center">
<img data-src="https://note.youdao.com/yws/api/personal/file/WEB8ccdb56ae2d2ddd63d7a13a576d23bb1?method=download&shareKey=69113f8f61e335d1864757cf6d288929" width="70%" height="70%"/> 

<p>目录项长度通常为4的倍数，不足4的倍数会在文件名末尾补上’\0’。可以看到，目录项包含文件对应的inode索引，因此获得这个索引之后，就可以根据该索引值计算出inode地址，然后就可以得到文件的inode了。这一个inode指向的文件也可能是目录文件，因此数据块中包含目录项，这样就可以根据多级目录来查询了。另外，不管是普通文件还是目录文件（这里将目录称之为“目录文件”），总会位于一个目录下，所有普通文件和目录都位于根目录’&#x2F;‘下，根目录是所有目录的父目录。<br>我本科学到这里的时候被绕晕了：要想找到数据块，必须找到文件的inode，而要找到文件的inode，又必须要知道目录项（目录项包含inode索引），而要找到目录项又必须先找到数据块（目录项本身又是目录文件数据块里面的内容）……寻找过程似乎是个死循环。这种看似死循环的过程，原因无外乎就是上层目录是无休止的，因此有个固定的目录就可以了，答案就是根目录’&#x2F;‘！每个分区都有自己的根目录，根目录是所有目录的父目录，在创建文件分区的时候就已经在一个固定死的位置写好了根目录的inode，查找文件时时都首先根据根目录inode获得根目录数据块，然后再查找这个数据块里面的目录项，最后递归查找，找到任意子目录的文件。因此查找&#x2F;home&#x2F;hello.txt文件的过程是：</p>
<ul>
<li>1、文件系统找到根目录’&#x2F;‘的inode</li>
<li>2、由根目录的inode找到根目录的数据块</li>
<li>3、根目录数据块中有home目录项，并由home目录项找到home这个目录文件的inode</li>
<li>5、由home目录文件的inode找到home目录的数据块</li>
<li>6、home目录数据块有hello.txt目录项，并由该目录项找到hollo.txt这个文件的inode</li>
<li>7、由hello.txt文件的inode找到对应的数据块，数据块存储着字符串的ASCII码值。</li>
</ul>
<h2 id="文件系统布局"><a href="#文件系统布局" class="headerlink" title="文件系统布局"></a>文件系统布局</h2><p>Ext2文件系统在磁盘上的布局如下图所示：<br><img data-src="https://note.youdao.com/yws/api/personal/file/WEB8773c112d52de95d6691bdec4e7ea012?method=download&shareKey=69113f8f61e335d1864757cf6d288929"><br>Ext2文件系统将若干个块分成一个组，一个分区可能有多个块组。</p>
<ul>
<li><p>在整个磁盘中，最开始一个块是引导块，包含引导操作系统的相关信息，MBR(Master Boot Record和Loader程序就在这个块中)。如果该磁盘不包含操作系统，则该块内容为空。NTFS文件系统称该之为分区引导扇区。</p>
</li>
<li><p>每个块组的第一块是超级块，是在为分区创建文件系统时创建的，超级块包含总的inode数量、块的数量、每块的大小（字节）、每组的块数等等这些重要信息，详细字段如下所示：</p>
<div style = "align: center">
<img data-src="https://note.youdao.com/yws/api/personal/file/WEBb353acd38c3d124728dfb939d9eb1472?method=download&shareKey=69113f8f61e335d1864757cf6d288929" width="70%" height="70%"/> 
</li>
<li><p>组描述符紧跟着超级块，记录着数据块位图从几号块开始、inode位图从几号块开始、inode节点从几号块开始等等信息，具体字段如下：</p>
<div style = "align: center">
<img data-src="https://note.youdao.com/yws/api/personal/file/WEB4f0be2bb01668eba716ad737927f1217?method=download&shareKey=69113f8f61e335d1864757cf6d288929" width="70%" height="70%"/>
</li>
<li><p>之后是数据块位图和inode位图，记录那些块被（数据块或者inode）使用过了，1比特表示对应的块被使用过了。</p>
</li>
<li><p>索引节点块存储所有inode。</p>
</li>
<li><p>后面的所有块均为存储数据的数据块（存储目录文件、普通文件）</p>
</li>
</ul>
<h2 id="Ext2文件系统实例"><a href="#Ext2文件系统实例" class="headerlink" title="Ext2文件系统实例"></a>Ext2文件系统实例</h2><p>现有一个磁盘had.raw，根目录的内容如下，一共4个文件（包括目录）：</p>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">.</span><br><span class="line">..</span><br><span class="line">lost+found</span><br><span class="line">hello.txt</span><br></pre></td></tr></table></figure>
<p>利用hexdump命令查看磁盘内容：</p>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexdump -C rootfs/hda.raw | less</span><br></pre></td></tr></table></figure>
<p>磁盘内容如下，可以根据各个块的字段来查看意义：</p>
<h3 id="超级块"><a href="#超级块" class="headerlink" title="超级块"></a>超级块</h3><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="number">00000000</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line">***</span><br><span class="line"><span class="comment">//以上为引导块（0号块），接下来为超级块（1号块）</span></span><br><span class="line"><span class="number">00000400</span>  <span class="number">00</span> <span class="number">01</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">08</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">66</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> cd <span class="number">07</span> <span class="number">00</span> <span class="number">00</span>  |........f.......|</span><br><span class="line">          ^_________^ ^_________^</span><br><span class="line">        s_inodes_count s_blocks_count</span><br><span class="line"><span class="number">00000410</span>  f4 <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">01</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line">                                   ^_________^</span><br><span class="line">                                   s_log_block_size</span><br><span class="line"><span class="number">00000420</span>  <span class="number">00</span> <span class="number">20</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">20</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">01</span> <span class="number">00</span> <span class="number">00</span> <span class="number">43</span> <span class="number">54</span> <span class="number">9</span>e <span class="number">5</span>e  |. ... ......CT.^|</span><br><span class="line">          ^_________^              ^_________^</span><br><span class="line">          s_blocks_per_group       s_inodes_per_group</span><br><span class="line"><span class="number">00000430</span>  c8 <span class="number">56</span> <span class="number">9</span>e <span class="number">5</span>e <span class="number">00</span> <span class="number">00</span> <span class="number">15</span> <span class="number">00</span>  <span class="number">53</span> ef <span class="number">01</span> <span class="number">00</span> <span class="number">01</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |.V.^....S.......|</span><br></pre></td></tr></table></figure>

<table>
<thead>
<tr>
<th align="center">字段</th>
<th align="center">值</th>
<th align="center">意义</th>
</tr>
</thead>
<tbody><tr>
<td align="center">s_inodes_count</td>
<td align="center">0x0100</td>
<td align="center">总共包含0x0100个inode</td>
</tr>
<tr>
<td align="center">s_blocks_count</td>
<td align="center">0x0800</td>
<td align="center">总共包含0x0800块</td>
</tr>
<tr>
<td align="center">s_log_block_size</td>
<td align="center">0x0000</td>
<td align="center">块大小为$1024\times{2^0}$，即1024B</td>
</tr>
<tr>
<td align="center">s_blocks_per_group</td>
<td align="center">0x2000</td>
<td align="center">每组包含0x2000块</td>
</tr>
<tr>
<td align="center">s_inodes_per_group</td>
<td align="center">0x0100</td>
<td align="center">每组包含0x0100(256)个inode，占$\frac{256}{8}&#x3D;32$个块</td>
</tr>
</tbody></table>
<p>其中每个inode占128字节，因此一个块包含$\frac{1024}{128}&#x3D;8$个inode。</p>
<h3 id="组描述符"><a href="#组描述符" class="headerlink" title="组描述符"></a>组描述符</h3><p>组描述符紧跟着超级块</p>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//以下为组描述符（2号块）</span></span><br><span class="line"><span class="number">00000800</span>  <span class="number">03</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">04</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">05</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> cd <span class="number">07</span> f4 <span class="number">00</span>  |................|</span><br><span class="line">          ^_________^ ^_________^  ^_________^</span><br><span class="line">     bg_clock_bitmap bg_inode_bitmap bg_inode_table</span><br><span class="line"><span class="number">00000810</span>  <span class="number">02</span> <span class="number">00</span> <span class="number">04</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line"><span class="number">00000820</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line">***</span><br></pre></td></tr></table></figure>

<table>
<thead>
<tr>
<th align="center">字段</th>
<th align="center">值</th>
<th align="center">意义</th>
</tr>
</thead>
<tbody><tr>
<td align="center">bg_clock_bitmap</td>
<td align="center">0x03</td>
<td align="center">数据块位图区从3号块开始</td>
</tr>
<tr>
<td align="center">bg_inode_bitmap</td>
<td align="center">0x04</td>
<td align="center">inode位图区从4号块开始</td>
</tr>
<tr>
<td align="center">bg_inode_table</td>
<td align="center">0x05</td>
<td align="center">inode区从5号块开始</td>
</tr>
</tbody></table>
<h3 id="数据区位图和inode位图-bitmap"><a href="#数据区位图和inode位图-bitmap" class="headerlink" title="数据区位图和inode位图(bitmap)"></a>数据区位图和inode位图(bitmap)</h3><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//以下为数据块位图区（3号块）</span></span><br><span class="line"><span class="number">00000</span>c00  ff ff ff ff ff ff <span class="number">01</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line"><span class="number">00000</span>c10  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line">***</span><br><span class="line"><span class="comment">//以下为i节点位图区（4号块）</span></span><br><span class="line"><span class="number">00001000</span>  ff <span class="number">0f</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line"><span class="number">00001010</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line"><span class="number">00001020</span>  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|</span><br><span class="line">***</span><br></pre></td></tr></table></figure>

<h3 id="inode区"><a href="#inode区" class="headerlink" title="inode区"></a>inode区</h3><p>inode区从5号块开始，因此起始地址应该是0x400$\times{5}&#x3D;$0x1400，查看此处数据。另外根目录的inode是定死的，位于inode区的第2个，地址就是0x1400+128$\times$2&#x3D;0x1480（inode区的第一个inode没有意义）：</p>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//以下为inode区（5号块）</span></span><br><span class="line"><span class="number">00001400</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line">***</span><br><span class="line"><span class="comment">//以下为2号i节点（i节点从1开始编号），即根目录的i节点</span></span><br><span class="line"><span class="number">00001480</span>  ed <span class="number">41</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">04</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">49</span> <span class="number">4</span>d <span class="number">9</span>e <span class="number">5</span>e <span class="number">46</span> <span class="number">4</span>a <span class="number">9</span>e <span class="number">5</span>e  |.A......IM.^FJ.^|</span><br><span class="line">                      ^_________^</span><br><span class="line">                      <span class="built_in">i_size</span>(bytes)</span><br><span class="line"><span class="number">00001490</span>  <span class="number">46</span> <span class="number">4</span>a <span class="number">9</span>e <span class="number">5</span>e <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">03</span> <span class="number">00</span> <span class="number">02</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |FJ.^............|</span><br><span class="line">                                               ^_________^</span><br><span class="line">                                                i_blocks</span><br><span class="line"><span class="number">000014</span>a0  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">01</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">25</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |........%.......|</span><br><span class="line">                                   ^_________^</span><br><span class="line">                                    i_block</span><br><span class="line"><span class="number">000014b</span>0  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line">***</span><br></pre></td></tr></table></figure>

<table>
<thead>
<tr>
<th align="center">字段</th>
<th align="center">值</th>
<th align="center">意义</th>
</tr>
</thead>
<tbody><tr>
<td align="center">i_size</td>
<td align="center">0x0400</td>
<td align="center">文件大小0x400B&#x3D;1KB</td>
</tr>
<tr>
<td align="center">i_blocks</td>
<td align="center">0x0002</td>
<td align="center">文件数据块数为2</td>
</tr>
<tr>
<td align="center">i_block</td>
<td align="center">0x0025</td>
<td align="center">第一个数据块的块号为37，偏移是0x400$\times$37&#x3D;0x9400</td>
</tr>
</tbody></table>
<h3 id="根目录数据块"><a href="#根目录数据块" class="headerlink" title="根目录数据块"></a>根目录数据块</h3><p>在地址0x9400处查看根目录数据块中的内容，其中记录着目录项：</p>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//以下为根目录的第一个数据块</span></span><br><span class="line"><span class="number">00009400</span>  <span class="number">02</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">0</span>c <span class="number">00</span> <span class="number">01</span> <span class="number">02</span>  <span class="number">2</span>e <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">02</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line">          ^_________^ ^___^ ^^ ^^  ^_________^ ^_________^</span><br><span class="line">          inode       rec_len      name         inode</span><br><span class="line">                            ^name_len </span><br><span class="line">                               ^file_type      ^第<span class="number">2</span>个目录项</span><br><span class="line"><span class="number">00009410</span>  <span class="number">0</span>c <span class="number">00</span> <span class="number">02</span> <span class="number">02</span> <span class="number">2</span>e <span class="number">2</span>e <span class="number">00</span> <span class="number">00</span>  <span class="number">0b</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">14</span> <span class="number">00</span> <span class="number">0</span>a <span class="number">02</span>  |................|</span><br><span class="line">          ^___^ ^^ ^^ ^_________^  ^_________^ ^___^ ^^ ^^</span><br><span class="line">                                   ^第<span class="number">3</span>个目录项</span><br><span class="line"><span class="number">00009420</span>  <span class="number">6</span>c <span class="number">6f</span> <span class="number">73</span> <span class="number">74</span> <span class="number">2b</span> <span class="number">66</span> <span class="number">6f</span> <span class="number">75</span>  <span class="number">6</span>e <span class="number">64</span> <span class="number">00</span> <span class="number">00</span> <span class="number">0</span>c <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |lost+found......|</span><br><span class="line">          ^__________________________________^ ^_________^</span><br><span class="line">          ^文件名lost+found，末尾用\<span class="number">0</span>补充        ^第<span class="number">4</span>个目录项</span><br><span class="line"><span class="number">00009430</span>  d4 <span class="number">03</span> <span class="number">09</span> <span class="number">01</span> <span class="number">68</span> <span class="number">65</span> <span class="number">6</span>c <span class="number">6</span>c  <span class="number">6f</span> <span class="number">2</span>e <span class="number">74</span> <span class="number">78</span> <span class="number">74</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |....hello.txt...|</span><br><span class="line">          ^___^ ^^ ^^ ^__________________________________^</span><br><span class="line">                      ^名字hello.txt</span><br><span class="line"><span class="number">00009440</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br></pre></td></tr></table></figure>

<table>
<thead>
<tr>
<th align="center">inode号</th>
<th align="center">目录项长度</th>
<th align="center">文件名长度</th>
<th align="center">文件类型</th>
<th align="center">文件名</th>
</tr>
</thead>
<tbody><tr>
<td align="center">0x02</td>
<td align="center">0x0c: 12 Bytes</td>
<td align="center">0x1</td>
<td align="center">目录</td>
<td align="center">.</td>
</tr>
<tr>
<td align="center">0x02</td>
<td align="center">0x0c: 12 Bytes</td>
<td align="center">0x1</td>
<td align="center">目录</td>
<td align="center">..</td>
</tr>
<tr>
<td align="center">0x0b</td>
<td align="center">0x14: 20 Bytes</td>
<td align="center">0x0a: 10</td>
<td align="center">目录</td>
<td align="center">lost+found</td>
</tr>
<tr>
<td align="center">0x0c</td>
<td align="center">0x3d4 Bytes</td>
<td align="center">0x09</td>
<td align="center">普通文件</td>
<td align="center">hello.txt</td>
</tr>
</tbody></table>
<p>这是根目录下的目录项，注意到第1个和第2个目录项的inode号都是0x02号inode，指向根目录自己（打开当前目录和打开上一级目录都是指向自己）。此外hello.txt的inode号为0x0c，因此hello.txt的inode的地址为0x1400+0x80$\times$(0x0c-1)&#x3D;0x1980，在此处查看hello.txt的inode信息。</p>
<h3 id="hello-txt的inode"><a href="#hello-txt的inode" class="headerlink" title="hello.txt的inode"></a>hello.txt的inode</h3><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//以下为hello.txt的i节点（12号）</span></span><br><span class="line"><span class="number">00001980</span>  a4 <span class="number">81</span> <span class="number">00</span> <span class="number">00</span> <span class="number">0</span>e <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">56</span> <span class="number">4</span>a <span class="number">9</span>e <span class="number">5</span>e <span class="number">46</span> <span class="number">4</span>a <span class="number">9</span>e <span class="number">5</span>e  |........VJ.^FJ.^|</span><br><span class="line"><span class="number">00001990</span>  <span class="number">46</span> <span class="number">4</span>a <span class="number">9</span>e <span class="number">5</span>e <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">01</span> <span class="number">00</span> <span class="number">02</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |FJ.^............|</span><br><span class="line"><span class="number">000019</span>a0  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">01</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">01</span> <span class="number">02</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line">                                   ^_________^</span><br><span class="line">                                     i_block:第一个数据块号</span><br><span class="line"><span class="number">000019b</span>0  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line">***</span><br></pre></td></tr></table></figure>
<p>hello.txt的inode信息说明第一个数据块的块号为0x0201，对应偏移是0x400$\times$0x201&#x3D;0x80400，查看该地址处的数据块的内容。</p>
<h3 id="hello-txt的数据块"><a href="#hello-txt的数据块" class="headerlink" title="hello.txt的数据块"></a>hello.txt的数据块</h3><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//以下为hello.txt的第一个数据块</span></span><br><span class="line"><span class="number">00080400</span>  <span class="number">48</span> <span class="number">65</span> <span class="number">6</span>c <span class="number">6</span>c <span class="number">6f</span> <span class="number">2</span>c <span class="number">20</span> <span class="number">77</span>  <span class="number">6f</span> <span class="number">72</span> <span class="number">6</span>c <span class="number">64</span> <span class="number">21</span> <span class="number">0</span>a <span class="number">00</span> <span class="number">00</span>  |Hello, world!...|</span><br><span class="line"><span class="number">00080410</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line">***</span><br></pre></td></tr></table></figure>
<p>数据块中存储着hello.txt的ASCII码。</p>
<h3 id="lost-found的inode"><a href="#lost-found的inode" class="headerlink" title="lost+found的inode"></a>lost+found的inode</h3><p>根目录中lost+found目录的inode编号为0x0b，因此lost+found目录文件的inode地址为0x1400+0x80$\times$(0x0b-1)&#x3D;0x1900，在此处查看lost+found的inode信息。</p>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//以下为lost+found的inode</span></span><br><span class="line"><span class="number">00001900</span>  ed <span class="number">41</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">30</span> <span class="number">00</span> <span class="number">00</span>  d7 <span class="number">49</span> <span class="number">9</span>e <span class="number">5</span>e d7 <span class="number">49</span> <span class="number">9</span>e <span class="number">5</span>e  |.A..<span class="number">.0</span>...I.^.I.^|</span><br><span class="line"><span class="number">00001910</span>  d7 <span class="number">49</span> <span class="number">9</span>e <span class="number">5</span>e <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">02</span> <span class="number">00</span> <span class="number">18</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |.I.^............|</span><br><span class="line"><span class="number">00001920</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">26</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">27</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |........&amp;..<span class="number">.&#x27;</span>...|</span><br><span class="line">                                   ^_________^ ^_________^</span><br><span class="line">                                     i_block     i_block</span><br><span class="line">                                 第一个数据块标号  第二个数据块标号</span><br><span class="line"><span class="number">00001930</span>  <span class="number">28</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">29</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">2</span>a <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">2b</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |(...)...*...+...|</span><br><span class="line"><span class="number">00001940</span>  <span class="number">2</span>c <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">2</span>d <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">2</span>e <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">2f</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |,...-......./...|</span><br><span class="line"><span class="number">00001950</span>  <span class="number">30</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">31</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |<span class="number">0.</span>.<span class="number">.1</span>...........|</span><br><span class="line"><span class="number">00001960</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line">***</span><br></pre></td></tr></table></figure>
<p>lost+found第一个数据块的块号为0x0026，对应偏移是0x400$\times$0x26&#x3D;0x9800，查看该地址处的数据块的内容。</p>
<h3 id="lost-found数据块内容"><a href="#lost-found数据块内容" class="headerlink" title="lost+found数据块内容"></a>lost+found数据块内容</h3><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//以下为lost+found的目录项数据块</span></span><br><span class="line"><span class="number">00009800</span>  <span class="number">0b</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">0</span>c <span class="number">00</span> <span class="number">01</span> <span class="number">02</span>  <span class="number">2</span>e <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">02</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line">          ^_________^ ^___^ ^^ ^^  ^_________^ ^_________^</span><br><span class="line">          inode       rec_len      name         inode</span><br><span class="line">                            ^name_len </span><br><span class="line">                               ^file_type      ^第<span class="number">2</span>个目录项</span><br><span class="line"><span class="number">00009810</span>  f4 <span class="number">03</span> <span class="number">02</span> <span class="number">02</span> <span class="number">2</span>e <span class="number">2</span>e <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line">          ^___^ ^^ ^^ ^_________^</span><br><span class="line"><span class="number">00009820</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line">***</span><br><span class="line"><span class="number">00009</span>c00  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">04</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line"><span class="number">00009</span>c10  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line">***</span><br></pre></td></tr></table></figure>
<table>
<thead>
<tr>
<th align="center">inode号</th>
<th align="center">目录项长度</th>
<th align="center">文件名长度</th>
<th align="center">文件类型</th>
<th align="center">文件名</th>
</tr>
</thead>
<tbody><tr>
<td align="center">0x0b</td>
<td align="center">0x0c: 12 Bytes</td>
<td align="center">0x1</td>
<td align="center">目录</td>
<td align="center">.</td>
</tr>
<tr>
<td align="center">0x02</td>
<td align="center">0x03f4Bytes</td>
<td align="center">0x2</td>
<td align="center">目录</td>
<td align="center">..</td>
</tr>
<tr>
<td align="center">当前目录inode指向自己，而上一级目录指向根目录。</td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
</tr>
</tbody></table>

    </div>

    
    
    
        

<div>
<ul class="post-copyright">
  <li class="post-copyright-author">
    <strong>本文作者： </strong>虎王
  </li>
  <li class="post-copyright-link">
    <strong>本文链接：</strong>
    <a href="https://chudod.gitee.io/works/2022/05/18/OS_FileSystem/" title="文件系统概念和Ext2文件系统">https://chudod.gitee.io/works/2022/05/18/OS_FileSystem/</a>
  </li>
  <li class="post-copyright-license">
    <strong>版权声明： </strong>本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" rel="noopener" target="_blank"><i class="fab fa-fw fa-creative-commons"></i>BY-NC-SA</a> 许可协议。转载请注明出处！
  </li>
</ul>
</div>

        

  <div class="followme">
    <p>欢迎关注我的其它发布渠道</p>

    <div class="social-list">

        <div class="social-item">
          <a target="_blank" class="social-link" href="/images/wechat_channel.jpg">
            <span class="icon">
              <i class="fab fa-weixin"></i>
            </span>

            <span class="label">WeChat</span>
          </a>
        </div>

        <div class="social-item">
          <a target="_blank" class="social-link" href="/atom.xml">
            <span class="icon">
              <i class="fa fa-rss"></i>
            </span>

            <span class="label">RSS</span>
          </a>
        </div>
    </div>
  </div>


      <footer class="post-footer">
          <div class="post-tags">
              <a href="/works/tags/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/" rel="tag"># 操作系统</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/works/2022/05/14/English_Sentences/" rel="prev" title="English Sentences">
      <i class="fa fa-chevron-left"></i> English Sentences
    </a></div>
      <div class="post-nav-item">
    <a href="/works/2022/05/24/Russian_Grammar/" rel="next" title="Русская Граммаатика(俄语语法)">
      Русская Граммаатика(俄语语法) <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F%E6%A6%82%E5%BF%B5"><span class="nav-number">1.</span> <span class="nav-text">文件系统概念</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#inode%E5%92%8C%E6%96%87%E4%BB%B6%E6%8E%A7%E5%88%B6%E5%9D%97FCB"><span class="nav-number">1.1.</span> <span class="nav-text">inode和文件控制块FCB</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E7%9B%AE%E5%BD%95%E9%A1%B9%E4%B8%8E%E7%9B%AE%E5%BD%95"><span class="nav-number">1.2.</span> <span class="nav-text">目录项与目录</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F%E5%B8%83%E5%B1%80"><span class="nav-number">1.3.</span> <span class="nav-text">文件系统布局</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Ext2%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F%E5%AE%9E%E4%BE%8B"><span class="nav-number">1.4.</span> <span class="nav-text">Ext2文件系统实例</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E8%B6%85%E7%BA%A7%E5%9D%97"><span class="nav-number">1.4.1.</span> <span class="nav-text">超级块</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E7%BB%84%E6%8F%8F%E8%BF%B0%E7%AC%A6"><span class="nav-number">1.4.2.</span> <span class="nav-text">组描述符</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%95%B0%E6%8D%AE%E5%8C%BA%E4%BD%8D%E5%9B%BE%E5%92%8Cinode%E4%BD%8D%E5%9B%BE-bitmap"><span class="nav-number">1.4.3.</span> <span class="nav-text">数据区位图和inode位图(bitmap)</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#inode%E5%8C%BA"><span class="nav-number">1.4.4.</span> <span class="nav-text">inode区</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%A0%B9%E7%9B%AE%E5%BD%95%E6%95%B0%E6%8D%AE%E5%9D%97"><span class="nav-number">1.4.5.</span> <span class="nav-text">根目录数据块</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#hello-txt%E7%9A%84inode"><span class="nav-number">1.4.6.</span> <span class="nav-text">hello.txt的inode</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#hello-txt%E7%9A%84%E6%95%B0%E6%8D%AE%E5%9D%97"><span class="nav-number">1.4.7.</span> <span class="nav-text">hello.txt的数据块</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#lost-found%E7%9A%84inode"><span class="nav-number">1.4.8.</span> <span class="nav-text">lost+found的inode</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#lost-found%E6%95%B0%E6%8D%AE%E5%9D%97%E5%86%85%E5%AE%B9"><span class="nav-number">1.4.9.</span> <span class="nav-text">lost+found数据块内容</span></a></li></ol></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="虎王"
      src="/works/images/avatar.png">
  <p class="site-author-name" itemprop="name">虎王</p>
  <div class="site-description" itemprop="description">喜欢造飞机导弹和计算机的大学生</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/works/archives/">
        
          <span class="site-state-item-count">21</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/works/categories/">
          
        <span class="site-state-item-count">13</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/works/tags/">
          
        <span class="site-state-item-count">12</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/DoD-Chu/" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;DoD-Chu&#x2F;" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:1368095113@qq.com" title="E-Mail → mailto:1368095113@qq.com" rel="noopener" target="_blank"><i class="fa fa-envelope fa-fw"></i>E-Mail</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://www.zhihu.com/people/pu-ti-shan-cheng-zhu" title="知乎 → https:&#x2F;&#x2F;www.zhihu.com&#x2F;people&#x2F;pu-ti-shan-cheng-zhu" rel="noopener" target="_blank"><i class="fab fa-stack-overflow fa-fw"></i>知乎</a>
      </span>
  </div>


  <div class="links-of-blogroll motion-element">
    <div class="links-of-blogroll-title"><i class="fa fa-link fa-fw"></i>
      其他站点
    </div>
    <ul class="links-of-blogroll-list">
        <li class="links-of-blogroll-item">
          <a href="https://www.zhihu.com/people/pu-ti-shan-cheng-zhu" title="https:&#x2F;&#x2F;www.zhihu.com&#x2F;people&#x2F;pu-ti-shan-cheng-zhu" rel="noopener" target="_blank">知乎主页</a>
        </li>
    </ul>
  </div>

      </div>
        <div class="back-to-top motion-element">
          <i class="fa fa-arrow-up"></i>
          <span>0%</span>
        </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; Fri Mar 25 2022 08:00:00 GMT+0800 (中国标准时间) – 
  <span itemprop="copyrightYear">2022</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">虎王</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> 强力驱动
  </div>

<div class="theme-info">
  <div class="powered-by"></div>
  <span class="post-count">博客全站共30.4k字</span>
</div>


    <script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>

    <span id="busuanzi_container_site_pv">总访问量<span id="busuanzi_value_site_pv"></span>次</span>
    <span class="post-meta-divider">|</span>
    <span id="busuanzi_container_site_uv">总访客数<span id="busuanzi_value_site_uv"></span>人</span>
    <span class="post-meta-divider">|</span>
<!-- 不蒜子计数初始值纠正 -->
<script>
$(document).ready(function() {

    var int = setInterval(fixCount, 50);  // 50ms周期检测函数
    var countOffset = 20000;  // 初始化首次数据

    function fixCount() {            
       if (document.getElementById("busuanzi_container_site_pv").style.display != "none")
        {
            $("#busuanzi_value_site_pv").html(parseInt($("#busuanzi_value_site_pv").html()) + countOffset); 
            clearInterval(int);
        }                  
        if ($("#busuanzi_container_site_pv").css("display") != "none")
        {
            $("#busuanzi_value_site_uv").html(parseInt($("#busuanzi_value_site_uv").html()) + countOffset); // 加上初始数据 
            clearInterval(int); // 停止检测
        }  
    }
       	
});
</script> 

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  
  <script color='0,0,255' opacity='0.5' zIndex='-1' count='99' src="/works/lib/canvas-nest/canvas-nest.min.js"></script>
  <script src="/works/lib/anime.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js"></script>
  <script src="//cdn.jsdelivr.net/gh/fancyapps/fancybox@3/dist/jquery.fancybox.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/lozad@1/dist/lozad.min.js"></script>
  <script src="/works/lib/velocity/velocity.min.js"></script>
  <script src="/works/lib/velocity/velocity.ui.min.js"></script>

<script src="/works/js/utils.js"></script>

<script src="/works/js/motion.js"></script>


<script src="/works/js/schemes/pisces.js"></script>


<script src="/works/js/next-boot.js"></script>

<script src="/works/js/bookmark.js"></script>




  
  <script>
    (function(){
      var canonicalURL, curProtocol;
      //Get the <link> tag
      var x=document.getElementsByTagName("link");
		//Find the last canonical URL
		if(x.length > 0){
			for (i=0;i<x.length;i++){
				if(x[i].rel.toLowerCase() == 'canonical' && x[i].href){
					canonicalURL=x[i].href;
				}
			}
		}
    //Get protocol
	    if (!canonicalURL){
	    	curProtocol = window.location.protocol.split(':')[0];
	    }
	    else{
	    	curProtocol = canonicalURL.split(':')[0];
	    }
      //Get current URL if the canonical URL does not exist
	    if (!canonicalURL) canonicalURL = window.location.href;
	    //Assign script content. Replace current URL with the canonical URL
      !function(){var e=/([http|https]:\/\/[a-zA-Z0-9\_\.]+\.baidu\.com)/gi,r=canonicalURL,t=document.referrer;if(!e.test(r)){var n=(String(curProtocol).toLowerCase() === 'https')?"https://sp0.baidu.com/9_Q4simg2RQJ8t7jm9iCKT-xh_/s.gif":"//api.share.baidu.com/s.gif";t?(n+="?r="+encodeURIComponent(document.referrer),r&&(n+="&l="+r)):r&&(n+="?l="+r);var i=new Image;i.src=n}}(window);})();
  </script>




  
<script src="//cdn.jsdelivr.net/npm/algoliasearch@4/dist/algoliasearch-lite.umd.js"></script>
<script src="//cdn.jsdelivr.net/npm/instantsearch.js@4/dist/instantsearch.production.min.js"></script>
<script src="/works/js/algolia-search.js"></script>










<script>
document.querySelectorAll('.pdfobject-container').forEach(element => {
  let url = element.dataset.target;
  let pdfOpenParams = {
    navpanes : 0,
    toolbar  : 0,
    statusbar: 0,
    pagemode : 'thumbs',
    view     : 'FitH'
  };
  let pdfOpenFragment = '#' + Object.entries(pdfOpenParams).map(([key, value]) => `${key}=${encodeURIComponent(value)}`).join('&');
  let fullURL = `/works/lib/pdf/web/viewer.html?file=${encodeURIComponent(url)}${pdfOpenFragment}`;

  if (NexT.utils.supportsPDFs()) {
    element.innerHTML = `<embed class="pdfobject" src="${url + pdfOpenFragment}" type="application/pdf" style="height: ${element.dataset.height};">`;
  } else {
    element.innerHTML = `<iframe src="${fullURL}" style="height: ${element.dataset.height};" frameborder="0"></iframe>`;
  }
});
</script>


<script>
if (document.querySelectorAll('pre.mermaid').length) {
  NexT.utils.getScript('//cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js', () => {
    mermaid.initialize({
      theme    : 'forest',
      logLevel : 3,
      flowchart: { curve     : 'linear' },
      gantt    : { axisFormat: '%m/%d/%Y' },
      sequence : { actorMargin: 50 }
    });
  }, window.mermaid);
}
</script>


  

  
      

<script>
  if (typeof MathJax === 'undefined') {
    window.MathJax = {
      loader: {
        source: {
          '[tex]/amsCd': '[tex]/amscd',
          '[tex]/AMScd': '[tex]/amscd'
        }
      },
      tex: {
        inlineMath: {'[+]': [['$', '$']]},
        tags: 'ams'
      },
      options: {
        renderActions: {
          findScript: [10, doc => {
            document.querySelectorAll('script[type^="math/tex"]').forEach(node => {
              const display = !!node.type.match(/; *mode=display/);
              const math = new doc.options.MathItem(node.textContent, doc.inputJax[0], display);
              const text = document.createTextNode('');
              node.parentNode.replaceChild(text, node);
              math.start = {node: text, delim: '', n: 0};
              math.end = {node: text, delim: '', n: 0};
              doc.math.push(math);
            });
          }, '', false],
          insertedScript: [200, () => {
            document.querySelectorAll('mjx-container').forEach(node => {
              let target = node.parentNode;
              if (target.nodeName.toLowerCase() === 'li') {
                target.parentNode.classList.add('has-jax');
              }
            });
          }, '', false]
        }
      }
    };
    (function () {
      var script = document.createElement('script');
      script.src = '//cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js';
      script.defer = true;
      document.head.appendChild(script);
    })();
  } else {
    MathJax.startup.document.state(0);
    MathJax.texReset();
    MathJax.typeset();
  }
</script>

    

  

</body>
</html>
